package com.sise.stuteaintersys.mapper;

import com.sise.stuteaintersys.bean.entity.Admin;
import com.sise.stuteaintersys.bean.entity.AdminExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
public interface AdminMapper {
    int countByExample(AdminExample example);

    int deleteByExample(AdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    List<Admin> selectByExample(AdminExample example);

    Admin selectByPrimaryKey(Integer id);


    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);

    /**
     * 查询所有学生
     * @return
     */
    @Select("SELECT * FROM admin")
    List<Admin> findAll();

    /**
     * 根据姓名进行查询
     * @param name
     * @return
     */
    @Select("SELECT * FROM admin WHERE admin.login_name =#{name}")
    List<Admin> checkAdmin(String name);
}